-
-
Notifications
You must be signed in to change notification settings - Fork 11
fix: add :eof to the terminator list in parse_stab_expression/1
#92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add :eof to the terminator list in parse_stab_expression/1
#92
Conversation
test/spitfire_test.exs
Outdated
| end | ||
|
|
||
| test "prefix stab expression does not exhaust fuel" do | ||
| assert Spitfire.parse("-> a") == |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests for valid code should assert it's the same as Code.string_to_quoted. There's a helper function for it you can see in other tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed the test, as it is not valid Elixir and Code.string_to_quoted returns an error. What i'm testing is just that we don't hit an infinite loop or exhaust the fuel. So the second test should be enough.
8cc0dc7 to
d255f32
Compare
|
It's not, even with #93 on main we still get an infinite loop without the fix in this pr |
|
@rma97 could you rebase this on main and then I think we can merge |
d255f32 to
a1fb50c
Compare
remove test fix test
a1fb50c to
2105d3a
Compare
done |
doorgan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! 💜
|
@doorgan I would love to help with both spitfire and expert, so I was wondering if you could use the "good first issue" tag or something like it, to easier ease into the codebase :) |
resolves #90
As I understand, the problems lies in the terminating list when doing
while2.In the given example in the issue, the loop continues, peek becomes
->, thenc, then:eof. At that point, without:eofin the terminator list, the loop would continue infinitely.If im completely off, feel free to close this PR.
Keep up the good work!